package com.ioc;

import com.ioc.dao.UserDao;
import com.ioc.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**

 *
 */
public class DITest01 {


    public static void main(String[] args) {
        //让Spring加载配置文件
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService = (UserService) ctx.getBean("userService");
        userService.save();
    }



}
